{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
<form action="" method="post">
<div class="tools_bar clearfix">
    <a class="icon-checkbox-checked icon-checkbox-unchecked" href="javascript:;" onclick="tools_select('id[]',this)" title="全选" data="true"> 全选 </a>
    <!-- 
    <a  class="icon-remove-2" href="javascript:;" onclick="tools_submit({action:'{url:/customer/withdraw_del}',msg:'删除后无法恢复，你真的删除吗？'})" title="删除"> 删除</a>
    -->
    <a class="icon-delicious" href="{url:/customer/withdraw_user_list}"> 全部记录</a>
    <!-- 
    <a style="color:red;" href="{url:/customer/download_widthdraw_execl_file}">导出提现记录</a>
    <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style="" > 筛选条件</a><input id="condition_input" type="hidden" name="condition" value="{$condition}"></span>
    -->
</div>
<input type="text" name="txt_username" id="txt_username" placeholder="请输入用户名" value="{$username}"/>&nbsp;<input type="button" value="搜索" onclick="search_do()"/>
<table class="default" >
    <tr>
        <th style="width:40px">选择</th>
        <th style="width:80px">用户</th>
        <th style="width:80px">申请总金额</th>
        <th style="width:80px">手续费总金额</th>
        <th style="width:80px">实发总金额</th>
        <th style="width:100px">购券总金额</th>   
    </tr>
    <!-- select user_id,sum(sq_money) as sq_money,sum(txf) as txf,sum(amount) as amount from zyk_withdraw where status=1 group by user_id; -->
    {list:items=$user_list key=$i}
        <tr>
        	<td>
        	{echo:$i+1}
        	<input type="checkbox" name="id[]" value="{$item['id']}">
        	</td>
        	<td>{$item['uname']}</td>
        	<td>{$item['total_sq_money']}</td>
        	<td>{$item['total_txf']}</td>
        	<td>{$item['total_amount']}</td>
        	<td>{echo:Common::get_user_gq_zje($item['user_id'])}</td>
        </tr>
    {/list}
</table>
</form>
<div class="page_nav">

</div>
<script type="text/javascript">
    var form =  new Form();
    $("#condition").on("click",function(){
        $("body").Condition({input:"#condition_input",okVal:'高级搜索',callback:function(data){tools_submit({action:'{url:/customer/withdraw_list}',method:'get'});},data:{'us.name':{name:'用户名'},'wd.name':{name:'账户名'},'type_name':{name:'名称'},account:{name:'账号'},amount:{name:'提现金额'},'wd.status':{name:'状态',values:{2:'失败',0:'待处理',1:'成功'}}
        }});
    });
    function withdrawAction(id)
    {
        art.dialog.open("{url:/customer/withdraw_view/id/}"+id,{id:'withdraw-dialog',title:"审批",width:620});
    }
    function close_dialog()
    {
        art.dialog({id:"withdraw-dialog"}).close();
        tools_reload();
    }
    function search_do()
    {
    	var username = $("#txt_username").val();

    	if( username == '' )
    	{
    		document.location.href = "{url:/customer/withdraw_user_list}";	
    	}
    	else
    	{
    		document.location.href = "{url:/customer/withdraw_user_list}&username="+username;
    	}
    	
    	/*
    	if(username != '')
    	{
    		document.location.href = "{url:/customer/withdraw_user_list}&username="+username:	
    	}
    	else
    	{
    		document.location.href = "{url:/customer/withdraw_user_list}";
    	}
    	*/
    	
    	
    }
</script>
